package Adrian_Kozica;

import static java.lang.Math.pow;
import static java.lang.Math.sqrt;

public class Prostokat {

	private double x;
	private double y;

	public void setX(double a) {
		x = a;
	}

	public double getX() {
		return x;
	}

	public void setY(double a) {
		y = a;
	}

	public double getY() {
		return y;
	}

	public Prostokat(Prostokat a) {
		x = a.x;
		y = a.y;
	}

	public Prostokat() {}

	public void UstalWartosc(double a, double b) {
		x = a;
		y = b;
	}

	public double Pole() {
		return x * y;
	}

	public double DlugoscPrzekatnej() {
		return sqrt(pow(x, 2) + pow(y, 2));
	}

	public static void main(String[] args) {
		Prostokat pros1 = new Prostokat();
		pros1.UstalWartosc(2, 5);
		Prostokat pros2 = new Prostokat(pros1);
		System.out.print(pros2.Pole());
	}
}
